home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat3 / Tk / focus.z / focus
Text File  |  1998-10-30  |  8KB  |  133 lines

  1.  
  2.  
  3.  
  4. ffffooooccccuuuussss((((3333TTTTkkkk))))                                                          ffffooooccccuuuussss((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      focus - Manage the input focus
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ffffooooccccuuuussss
  13.      ffffooooccccuuuussss _w_i_n_d_o_w
  14.      ffffooooccccuuuussss _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  15.  
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      The ffffooooccccuuuussss command is used to manage the Tk input focus.  At any given    |
  19.      time, one window on each display is designated as the _f_o_c_u_s _w_i_n_d_o_w;  any |
  20.      key press or key release events for the display are sent to that window. |
  21.      It is normally up to the window manager to redirect the focus among the  |
  22.      top-level windows of a display.  For example, some window managers       |
  23.      automatically set the input focus to a top-level window whenever the     |
  24.      mouse enters it;  others redirect the input focus only when the user     |
  25.      clicks on a window.  Usually the window manager will set the focus only  |
  26.      to top-level windows, leaving it up to the application to redirect the   |
  27.      focus among the children of the top-level.                               |
  28.  
  29.      Tk remembers one focus window for each top-level (the most recent        |
  30.      descendant of that top-level to receive the focus);  when the window     |
  31.      manager gives the focus to a top-level, Tk automatically redirects it to |
  32.      the remembered window.  Within a top-level Tk uses an _e_x_p_l_i_c_i_t focus     |
  33.      model by default.  Moving the mouse within a top-level does not normally |
  34.      change the focus;  the focus changes only when a widget decides          |
  35.      explicitly to claim the focus (e.g., because of a button click), or when |
  36.      the user types a key such as Tab that moves the focus.                   |
  37.  
  38.      The Tcl procedure ttttkkkk____ffffooooccccuuuussssFFFFoooolllllllloooowwwwssssMMMMoooouuuusssseeee may be invoked to create an       |
  39.      _i_m_p_l_i_c_i_t focus model:  it reconfigures Tk so that the focus is set to a  |
  40.      window whenever the mouse enters it.  The Tcl procedures ttttkkkk____ffffooooccccuuuussssNNNNeeeexxxxtttt and|
  41.      ttttkkkk____ffffooooccccuuuussssPPPPrrrreeeevvvv implement a focus order among the windows of a top-level;   |
  42.      they are used in the default bindings for Tab and Shift-Tab, among other |
  43.      things.                                                                  |
  44.  
  45.      The ffffooooccccuuuussss command can take any of the following forms:                   |
  46.  
  47.      ffffooooccccuuuussss                                                                         ||
  48.           Returns the path name of the focus window on the display containing |
  49.           the application's main window,  or an empty string if no window in  |
  50.           this application has the focus on that display.   Note:  it is      |
  51.           better to specify the display explicitly using ----ddddiiiissssppppllllaaaayyyyooooffff (see      |
  52.           below) so that the code will work in applications using multiple    |
  53.           displays.                                                           |
  54.  
  55.      ffffooooccccuuuussss _w_i_n_d_o_w                                                                  ||
  56.           If the application currently has the input focus on _w_i_n_d_o_w's        |
  57.           display, this command resets the input focus for _w_i_n_d_o_w's display to|
  58.           _w_i_n_d_o_w and returns an empty string.  If the application doesn't     |
  59.           currently have the  input focus on _w_i_n_d_o_w's display, _w_i_n_d_o_w will be |
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ffffooooccccuuuussss((((3333TTTTkkkk))))                                                          ffffooooccccuuuussss((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.           remembered as the focus for its top-level;  the next time the focus |
  75.           arrives at the top-level, Tk will redirect it to _w_i_n_d_o_w.  If _w_i_n_d_o_w |
  76.           is an empty string then the command does nothing.                   |
  77.  
  78.      ffffooooccccuuuussss ----ddddiiiissssppppllllaaaayyyyooooffff _w_i_n_d_o_w                                                       ||
  79.           Returns the name of the focus window on the display containing      |
  80.           _w_i_n_d_o_w.  If the focus window for _w_i_n_d_o_w's display isn't in this     |
  81.           application, the return value is an empty string.                   |
  82.  
  83.      ffffooooccccuuuussss ----ffffoooorrrrcccceeee _w_i_n_d_o_w                                                           ||
  84.           Sets the focus of _w_i_n_d_o_w's display to _w_i_n_d_o_w, even if the           |
  85.           application doesn't currently have the input focus for the display. |
  86.           This command should be used sparingly, if at all.  In normal usage, |
  87.           an application should not claim the focus for itself;  instead, it  |
  88.           should wait for the window manager to give it the focus.  If _w_i_n_d_o_w |
  89.           is an empty string then the command does nothing.                   |
  90.  
  91.      ffffooooccccuuuussss ----llllaaaassssttttffffoooorrrr _w_i_n_d_o_w                                                         ||
  92.           Returns the name of the most recent window to have the input focus  |
  93.           among all the windows in the same top-level as _w_i_n_d_o_w.  If no window|
  94.           in that top-level has ever had the input focus, or if the most      |
  95.           recent focus window has been deleted, then the name of the top-level|
  96.           is returned.  The return value is the window that will receive the  |
  97.           input focus the next time the window manager gives the focus to the |
  98.           top-level.                                                          |
  99.  
  100.  
  101. QQQQUUUUIIIIRRRRKKKKSSSS                                                                        ||||
  102.      When an internal window receives the input focus, Tk doesn't actually set|
  103.      the X focus to that window;  as far as X is concerned, the focus will    |
  104.      stay on the top-level window containing the window with the focus.       |
  105.      However, Tk generates FocusIn and FocusOut events just as if the X focus |
  106.      were on the internal window.   This approach gets around a number of     |
  107.      problems that would occur if the X focus were actually moved; the fact   |
  108.      that the X focus is on the top-level is invisible unless you use C code  |
  109.      to query the X server directly.
  110.  
  111.  
  112. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  113.      events, focus, keyboard, top-level, window manager
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.